package reflection.p2;

import reflection.p1.Person;

import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;

public class Example02 {
    public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException, NoSuchMethodException, InvocationTargetException {
        Class<?>c=null;
        c=Class.forName("reflection.p1.Person");
Object o=c.getDeclaredConstructor().newInstance();
        Person p=(Person)o;
p.sayHello();

        Constructor<?>[]constructors=o.getClass().getConstructors();



    }
}
